// 快速布局样式
// flex弹性布局
.flex {
    display: flex;
}
.flex-1{
	flex: 1;
}
.flex-direction {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-row {
    flex-direction: row;
}

.align-start {
    align-items: flex-start;
}

.align-end {
    align-items: flex-end;
}

.align-center {
    align-items: center;
}

.align-stretch {
    align-items: stretch;
}

.self-start {
    align-self: flex-start;
}

.self-center {
    align-self: flex-center;
}

.self-end {
    align-self: flex-end;
}

.self-stretch {
    align-self: stretch;
}

.align-stretch {
    align-items: stretch;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

@for $i from 1 through 100 {
    .flex-basis-#{$i} {
        flex-basis: $i#{'%'};
    }
}

@for $i from 0 through 10 {
    .flex-shrink-#{$i} {
        flex-shrink: $i;
    }
    .flex-#{$i} {
        flex: $i;
    }
}

// grid布局
.grid {
    display: flex;
    flex-wrap: wrap;
}

.grid.grid-square {
    overflow: hidden;
}

.grid.grid-square > view {
    margin-right: 30rpx;
    border-radius: 6rpx;
    position: relative;
    overflow: hidden;
}

.grid.grid-oblong > view {
    margin-right: 30rpx;
    position: relative;
}

.grid.grid-square > view.bottom {
    margin-bottom: 30rpx;
}

.grid.grid-oblong > view.bottom {
    margin-bottom: 30rpx;
}

.grid.grid-square > view.bg-img image {
    width: 100%;
    height: 100%;
    position: absolute;
}

.grid.col-1.grid-square > view {
    padding-bottom: 100%;
    height: 0;
    margin-right: 0;
}

.grid.col-2.grid-square > view {
    padding-bottom: calc((100% - 30rpx) / 2);
    height: 0;
    width: calc((100% - 30rpx) / 2);
}

.grid.col-3.grid-square > view {
    padding-bottom: calc((100% - 60rpx) / 3);
    height: 0;
    width: calc((100% - 60rpx) / 3);
}

.grid.col-4.grid-square > view {
    padding-bottom: calc((100% - 90rpx) / 4);
    height: 0;
    width: calc((100% - 90rpx) / 4);
}

.grid.col-5.grid-square > view {
    padding-bottom: calc((100% - 120rpx) / 5);
    height: 0;
    width: calc((100% - 120rpx) / 5);
}

.grid.col-2.grid-oblong > view {
    width: calc((100% - 30rpx) / 2);
}

.grid.col-3.grid-oblong > view {
    width: calc((100% - 60rpx) / 3);
}

.grid.col-4.grid-oblong > view {
    width: calc((100% - 90rpx) / 4);
}

.grid.col-5.grid-oblong > view {
    width: calc((100% - 120rpx) / 5);
}

.grid.col-1 > view {
    width: 100%;
}

.grid.col-2 > view {
    width: 50%;
}

.grid.col-3 > view {
    width: 33.33%;
}

.grid.col-4 > view {
    width: 25%;
}

.grid.col-5 > view {
    width: 20%;
}

.grid.col-2.grid-square > view:nth-child(2n),
.grid.col-3.grid-square > view:nth-child(3n),
.grid.col-4.grid-square > view:nth-child(4n),
.grid.col-5.grid-square > view:nth-child(5n),
.grid.col-2.grid-oblong > view:nth-child(2n),
.grid.col-3.grid-oblong > view:nth-child(3n),
.grid.col-4.grid-oblong > view:nth-child(4n),
.grid.col-5.grid-oblong > view:nth-child(5n) {
    margin-right: 0;
}

// 圆角
.round {
    border-radius: 100%;
}
@for $i from 0 through 30 {
    .radius-#{$i} {
        border-radius: $i + rpx;
    }

    .radius-tl-#{$i} {
        border-top-left-radius: $i + rpx;
    }

    .radius-tr-#{$i} {
        border-top-right-radius: $i + rpx;
    }

    .radius-bl-#{$i} {
        border-bottom-left-radius: $i + rpx;
    }

    .radius-br-#{$i} {
        border-bottom-right-radius: $i + rpx;
    }
}

// 外间距
.margin-left-auto {
    margin-left: auto;
}

.margin-right-auto {
    margin-right: auto;
}

.margin-lr-auto {
    margin-left: auto;
    margin-right: auto;
}
.margin-top-auto {
    margin-top: auto;
}
.margin-bottom-auto {
    margin-bottom: auto;
}

@for $i from 0 through 60 {
    .margin-#{$i} {
        margin: $i + rpx;
    }

    .margin-left-#{$i} {
        margin-left: $i + rpx;
    }

    .margin-right-#{$i} {
        margin-right: $i + rpx;
    }

    .margin-top-#{$i} {
        margin-top: $i + rpx;
    }

    .margin-bottom-#{$i} {
        margin-bottom: $i + rpx;
    }

    .margin-lr-#{$i} {
        margin-left: $i + rpx;
        margin-right: $i + rpx;
    }

    .margin-tb-#{$i} {
        margin-top: $i + rpx;
        margin-bottom: $i + rpx;
    }
}

// 内间距
@for $i from 0 through 60 {
    .padding-#{$i} {
        padding: $i + rpx !important;
    }

    .padding-left-#{$i} {
        padding-left: $i + rpx !important;
    }

    .padding-right-#{$i} {
        padding-right: $i + rpx !important;
    }

    .padding-top-#{$i} {
        padding-top: $i + rpx !important;
    }

    .padding-bottom-#{$i} {
        padding-bottom: $i + rpx !important;
    }

    .padding-lr-#{$i} {
        padding-left: $i + rpx !important;
        padding-right: $i + rpx !important;
    }

    .padding-tb-#{$i} {
        padding-top: $i + rpx !important;
        padding-bottom: $i + rpx !important;
    }
}

/* 边框 */
@for $i from 1 through 5 {
    .solid-#{$i},
    .dashed-#{$i} {
        position: relative;
    }
    .solid-#{$i}::after {
        content: ' ';
        width: 200%;
        height: 200%;
        position: absolute;
        top: 0;
        left: 0;
        border-radius: inherit;
        transform: scale(0.5);
        transform-origin: 0 0;
        pointer-events: none;
        box-sizing: border-box;
        border: $i + rpx solid #F8F9FA;
    }
    .dashed-#{$i}::after {
        content: ' ';
        width: 200%;
        height: 200%;
        position: absolute;
        top: 0;
        left: 0;
        border-radius: inherit;
        transform: scale(0.5);
        transform-origin: 0 0;
        pointer-events: none;
        box-sizing: border-box;
        border: $i + rpx dashed #F8F9FA;
    }
    @each $direction in left, top, right, bottom {
        .solid-#{$direction}-#{$i},
        .dashed-#{$direction}-#{$i} {
            position: relative;
        }
        .solid-#{$direction}-#{$i}::after {
            content: ' ';
            width: 200%;
            height: 200%;
            position: absolute;
            top: 0;
            left: 0;
            border-radius: inherit;
            transform: scale(0.5);
            transform-origin: 0 0;
            pointer-events: none;
            box-sizing: border-box;
            border-#{$direction}: $i + rpx solid #F8F9FA;
        }
        .dashed-#{$direction}-#{$i}::after {
            content: ' ';
            width: 200%;
            height: 200%;
            position: absolute;
            top: 0;
            left: 0;
            border-radius: inherit;
            transform: scale(0.5);
            transform-origin: 0 0;
            pointer-events: none;
            box-sizing: border-box;
            border-#{$direction}: $i + rpx dashed #F8F9FA;
        }
    }
}

// 字体大小
@for $i from 0 through 50 {
    // 只要双数和能被5除尽的数
    @if $i % 2 == 0 or $i % 5 == 0 {
        .font-#{$i} {
            font-size: $i + rpx;
        }
    }
}

// 文字样式
@for $i from 1 through 5 {
    .text-cut-#{$i} {
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-all;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: $i;

    }
}
.webkit-box{
	display: -webkit-box;
}
// 透明
@for $i from 0 through 10 {
    .opacity-#{$i} {
        opacity: $i * 0.1;
    }
}

.click-animation:active {
    transform: translate(2rpx, 2rpx);
}
.text-Abc {
    text-transform: Capitalize;
}

.text-ABC {
    text-transform: Uppercase;
}

.text-abc {
    text-transform: Lowercase;
}

.text-price::before {
    content: '¥';
    font-size: 80%;
    margin-right: 4upx;
}
.text-required::before {
    content: '*';
    color: #ff3333;
    font-size: 80%;
    margin-right: 2upx;
}

.font-500 {
    font-weight: 500;
}
.font-600 {
    font-weight: 600;
}

.font-bold {
    font-weight: bold;
}

.font-bolder {
	font-weight: bolder;
}
.text-center {
    text-align: center;
}

.text-line {
    line-height: 1;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

// 文字颜色
.text-red{
   color: #FF0000;
}
.color-333{
	color: #333;
}
.color-666{
	color: #666;
}
.color-999 {
    color: #999999;
}

.color-gray {
    color: #aaaaaa;
}

.color-black {
    color: #333333;
}

.color-white {
    color: #ffffff;
}

.color-main {
    color: $-color-theme;
}

// 背景色
.bg-main {
    background-color: $-color-theme;
}

.max-width {
    width: 100%;
}

.max-height{
    height: 100%;
}

// 盒模型
view,
scroll-view,
swiper,
button,
input,
textarea,
label,
navigator,
image {
    box-sizing: border-box;
}

.filter-gray{
	filter: grayscale(100%);
}
.text-nowrap{
	white-space: pre;
	overflow: hidden;
}
